package com.example.demo.vo.common;

import com.github.pagehelper.PageRowBounds;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 接收前端分页参数
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageableVO {
    private Integer page = 1;
    private Integer size = 20;

    public PageRowBounds getBounds() {
        int offset = (page - 1) * size;
        return new PageRowBounds(offset, size);
    }
}
